import { createRouter, createWebHistory } from 'vue-router'
import login from '../components/login.vue'
import register from "../components/register";
const index =() => import('../components/index')
const home =() =>import('../components/home')
const studentList =() =>import('../components/studentList')
const classlist =() =>import('../components/classlist')
const querystudent =() =>import('../components/querystudent')
const classdetails =() =>import('../components/classdetails')

const routes = [
  {
    path: '',
    redirect:'/index'
  },

  {
    path: '/index',
    component:index,
    redirect: '/login',
    children:[
      {
        path: '/login',
        name: 'login',
        component: login
      },
      {
        path: '/register',
        name: 'register',
        component: register
      },
    ]
  },

  {
    path: '/home',
    component:home,
    redirect:"/studentList",
    children: [
      {
        path: '/studentList',
        name: 'studentList',
        component: studentList,
      },
      {
        path: '/classdetails',
        name: 'classdetails',
        component: classdetails,
      },
      {
        path: '/querystudent',
        name: 'querystudent',
        component: querystudent,
      },
      {
        path: '/classlist',
        name: 'classlist',
        component: classlist
      },
    ]
  }




]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
